<template>
  <div>

    <p>
      <a href="https://github.com/surmon-china/vue-codemirror">vue-codemirror </a>
      代码编辑器
    </p>
    <codemirror  v-model="code" :options="cmOptions" />

  </div>
</template>

<script>
import 'codemirror/lib/codemirror.css'
// import language js
import 'codemirror/mode/javascript/javascript.js'
// import theme style
import 'codemirror/theme/base16-dark.css'

export default {
  name: "TestVueCodemirror",

  data() {
    return {
      code: 'const a = 10',
      cmOptions: {
        tabSize: 4,
        mode: 'text/javascript',
        theme: 'base16-dark',
        lineNumbers: true,
        line: true,
        // more CodeMirror options...
      }
    }
  },


}
</script>

<style scoped>

</style>
